<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
        <title>Fuck the police!!!</title>
        <script type="text/javascript">
            legal_num_char_nombre = 20;
            legal_num_char_apellidos = 50;
            legal_num_char_city = 30;
            legal_num_char_tlf = 13;
            legal_num_char_mail = 40;
            legal_num_char_password = 20;
            function tryVars(){
                num_char_nombre = document.reg_user_form.nombre_form.value.length;
                num_char_apellidos = document.reg_user_form.apellidos_form.value.length;
                num_char_tlf = document.reg_user_form.telefono_form.value.length;
                num_char_city = document.reg_user_form.city_form.value.length;
                num_char_mail = document.reg_user_form.mail_form.value.length;
                num_char_password = document.reg_user_form.password_form.value.length;
                if (((num_char_nombre > legal_num_char_nombre) && (num_char_nombre > 0)) || (num_char_nombre < 1)){
                    document.reg_user_form.nombre_form.value = "";
                    document.reg_user_form.nombre_form.focus();
                    alert("El nombre no es valido.");
                    return 0;
                }
                if (((num_char_apellidos > legal_num_char_apellidos) && (num_char_apellidos > 0)) || (num_char_apellidos < 1)){
                    document.reg_user_form.apellidos_form.value = "";
                    document.reg_user_form.apellidos_form.focus();
                    alert("Los apellidos no son validos.");
                    return 0;
                }
                if (((num_char_tlf > legal_num_char_tlf) && (num_char_tlf > 0)) || (num_char_tlf < 1)){
                    document.reg_user_form.telefono_form.value = "";
                    document.reg_user_form.telefono_form.focus();
                    alert("El telefono no es valido.");
                    return 0;
                }
                if (((num_char_city > legal_num_char_city) && (num_char_city > 0)) || (num_char_city < 1)){
                    document.reg_user_form.city_form.value = "";
                    document.reg_user_form.city_form.focus();
                    alert("La ciudad no es valida.");
                    return 0;
                }
                if ((document.reg_user_form.mail_form.value.indexOf('@', 0) == -1) || (document.reg_user_form.mail_form.value.length < 5)) {
                    document.reg_user_form.mail_form.value = "";
                    document.reg_user_form.mail_form.focus();
                    alert("La direccion de correo electronico no es valida.");
                    return 0;
                }
                if (((num_char_password > legal_num_char_password) && (num_char_password > 0)) || (num_char_password < 1)){
                    document.reg_user_form.password_form.value = "";
                    document.reg_user_form.password_form.focus();
                    alert("La contraseña no es valida.");
                    return 0;
                }
                if ((document.reg_user_form.password_form.value != document.reg_user_form.password2_form.value)){
                    document.reg_user_form.password2_form.value = "";
                    document.reg_user_form.password2_form.focus();
                    alert("La contraseña introducida no coincide con la anterior.");
                    return 0;
                }
                document.reg_user_form.subbmit();
            }
        </script>
        <title>Fuck the police!!!</title>
    </head>
    <body>
        <form name="reg_user_form" method="post" action="AñadeUsuario.php">
            <p><b>Nombre</b> <input type="text" name="nombre_form" size="20"></p>
            <p><b>Apellidos</b> <input type="text" name="apellidos_form" size="50"></p>
            <p><b>Telefono</b> <input type="text" name="telefono_form" size="13"></p>
            <p><b>Ciudad</b> <input type="text" name="city_form" size="30"></p>
            <p><b>Email</b> <input type="text" name="mail_form" size="40"></p>
            <p><b>Contraseña</b> <input type="password" name="password_form" size="20"></p>
            <p><b>Repita la contraseña</b> <input type="password" name="password2_form" size="20"></p>
            <p><input type="button" value="Enviar" onClick="tryVars()"></p>
        </form>
    </body>
</html>
